package dk.hewison.client.data;

import com.google.gwt.user.client.rpc.AsyncCallback;
import dk.hewison.client.Log;

/**
 * @author John Hewison
 * @author $LastChangedBy: john.hewison $:  $ $LastChangedDate: 2009-02-01 11:43:54 +0000 (Sun, 01 Feb 2009) $:
 * @version $Revision: 35 $:
 */
public abstract class Callback<T> implements AsyncCallback<T> {

    public void onFailure(Throwable caught) {
        Log.error(caught.toString());
    }

    public void onSuccess(T result) {
        doSuccess(result);
    }

    public abstract void doSuccess(T result);
}
